﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace Common.Utils.Extend
{
    public static class MemberInfoExtend
    {
        public static T GetAttribute<T>(this MemberInfo memberInfo)where T: Attribute
        {
            var attribute = (T?)Attribute.GetCustomAttribute(memberInfo, typeof(T));
            return attribute;
        }

        public static T GetAttribute<T,F>() where T : Attribute
        {
            var attribute = (T?)Attribute.GetCustomAttribute(typeof(F), typeof(T));
            return attribute;
        }

    }
}
